<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!doctype html>
 <html lang="zh-CN">
 <head>
   <meta charset="UTF-8">
   <%@ include file="/share/systemInclude.jsp" %>
   
   <script type="text/javascript">
      $(function(){  
        $(".list_table").colResizable({
          liveDrag:true,
          gripInnerHtml:"<div class='grip'></div>", 
          draggingClass:"dragging", 
          minWidth:30
        }); 
      });
      
      function search(id){
      	$('#'+id).submit();
      }
      
      function getData(){
		var checkboxs = $('.chebox:checked');
		//判断是否只选中了一条记录
    	if(checkboxs.length == 1){
    		//获取所选记录对应的行的id
    		var shopId = $('.chebox:checked').attr("value");
    		var cityId = $('.chebox:checked').next().attr("value");
    		if(shopId != '' && shopId != null && shopId != undefined){
    		//返回对象主键和城市主键
    			return shopId+"&"+cityId;
    		}else{
    			return "-1";
    		}
		}else{
			return "-2";
		}
	}
   </script>
   <title>Document</title>
 </head>
 <body>
  <div class="container">
    <div id="search_bar" class="">
       <div class="box">
          <div class="box_border">
            <div class="box_top"><b class="pl15">搜索</b></div>
            <div class="box_center pt10 pb10">
            	<form id="searchForm" action="${root}/control/scroll/scrollImageController/assignObjList.do" method="post">
			  		<input type="hidden" name="scrollType" value="${fn:escapeXml(siform.scrollType)}" class="input-text lh30" size="40" />
			  		<input type="hidden" name="scrollObjId" value="${fn:escapeXml(siform.scrollObjId)}" class="input-text lh30" size="40" />
			  		<table class="form_table" border="0" cellpadding="0" cellspacing="0">
			  			<tr>
			  				<td>名称:</td>
			  				<td><input type="text" name="shopName" value="${fn:escapeXml(form.shopName)}" class="input-text lh30" size="40" /></td>
			  				<td>城市:</td>
			  				<td>
			  					<span class="fl">
			                      <div class="select_border"> 
			                        <div class="select_containers ">
			                        <c:if test="${not empty cityList }">
			                        	<select name="cityId" class="select" style="width:150px;">
				                        	<option value="">Please Choose!</option>
				                        	<c:forEach items="${cityList }" var="city">
				                        		<option value="${city.cityId }" <c:if test="${form.cityId == city.cityId }">selected="selected"</c:if>>${fn:escapeXml(city.cityName)}</option>	
				                        	</c:forEach>
				                        </select>
			                        </c:if>
			                        <c:if test="${empty cityList }">
			                        	<select name="cityId" class="select" >
				                        	<option>请先进行城市管理</option>
				                        </select>
			                        </c:if>
			                        </div> 
			                      </div> 
			                    </span>
			  				</td>
			  				<td><input type="button" name="button" class="btn btn82 btn_search" onclick="search('searchForm');" value="查询"> </td>
			  			</tr>
			  		</table>
			  	</form>
            </div>
          </div>
        </div>
    </div>
     <div id="table" class="mt10">
        <div class="box span10 oh">
              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="list_table">
                <tr>
                   <th width="30">选择</th>
                   <th width="60">店铺名称</th>
                   <th width="100">店铺Logo</th>
                   <th width="80">联系人</th>
                   <th width="200">地址</th>
                   <th width="80">电话</th>
                   <th width="100">创建时间</th>
                   <!-- <th width="45">状态</th>
                   <th width="140">操作</th> -->
                </tr>
                <c:if test="${not empty pageView.records }">
	  				<c:forEach items="${pageView.records }" var="entity">
	  					<tr class="tr">
		                   <td align="center">
		                   	<input class="chebox" type="radio" name="shopId" <c:if test="${siform.scrollObjId ==  entity.shopId}">checked="checked"</c:if> value="${entity.shopId }">
		                   	<input type="hidden"  value="${fn:escapeXml(entity.cityId)}" class="input-text lh30" size="40" />
		                   </td>
		                   <td>${fn:escapeXml(entity.shopName)}</td>
		                   <td align="center"><img src="${imageService }${entity.shopLogo}" width="100" height="100" /></td>
		                   <td><span title="${fn:escapeXml(entity.shopContact)}">${fn:escapeXml(entity.shopContact)}</span></td>
		                   <td><span title="${fn:escapeXml(entity.shopAddress)}">${fn:escapeXml(entity.shopAddress)}</span></td>
		                   <td>${entity.contactTel }</td>
		                   <td align="center"><fmt:formatDate value="${entity.shopCreateTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
		                   <%-- <td align="center">
		                   		<c:if test="${entity.shopStatus == 1}">使用中</c:if>
		                   		<c:if test="${entity.shopStatus == 2}">冻结中</c:if>
		                   		<c:if test="${entity.shopStatus == 3}">已删除</c:if>
		                   </td>
		                   <td>
		                   		<c:if test="${entity.shopStatus == 1}">
		                   			<input type="button" name="button" class="btn btn82 btn_res" onclick="editStatus('2','冻结','${entity.shopId}','${entity.shopName }')" value="冻结">
		                   			<input type="button" name="button" class="btn btn82 btn_del" onclick="editStatus('3','删除','${entity.shopId}','${entity.shopName }')" value="删除">
		                   		</c:if>
	                   			<c:if test="${entity.shopStatus == 2}">
	                   				<input type="button" name="button" class="btn btn82 btn_res" onclick="editStatus('1','恢复','${entity.shopId}','${entity.shopName }')" value="恢复">
		                   			<input type="button" name="button" class="btn btn82 btn_del" onclick="editStatus('3','删除','${entity.shopId}','${entity.shopName }')" value="删除">
	                   			</c:if>
	                   			<c:if test="${entity.shopStatus == 3}"></c:if>
		                   </td> --%>
		                </tr>
	  				</c:forEach>
	  			</c:if>
	  			<c:if test="${empty pageView.records }">
	  				
	  			</c:if>
              </table>
              <%@ include file="/share/systemPagination.jsp" %>
        </div>
     </div>
   </div> 
 </body>
 </html>
  